import javax.sql.rowset.Joinable;
import java.time.LocalDateTime;

public class J111201 {
    static long ret1 = 0;
    static long ret2 = 0;
    public static void main(String[] args) throws InterruptedException {
        int[] nums = new int[10000001];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = i;
        }
        double ts = System.currentTimeMillis();
        Thread t1 = new Thread() {
            int i = 0;
            @Override
            public void run() {
                while (i < nums.length) {
                    ret1 += nums[i];
                    i += 2;
                }
            }
        };

        Thread t2 = new Thread() {
            int j = 1;
            @Override
            public void run() {
                while (j < nums.length) {
                    ret2 += nums[j];
                    j += 2;
                }
            }
        };
        t1.start();
        t2.start();
        t1.join();
        t2.join();
        double te = System.currentTimeMillis();
        System.out.println(te - ts + " " + (ret1 + ret2));
    }
}
